#ifndef LINEMESSAGE_H
#define LINEMESSAGE_H

#include <QWidget>
#include<QLabel>

//消息用户
typedef enum{
    MessageUser_self,//好友消息
    MessageUser_Friend,//用户消息
}MessageUser;
typedef struct StLineMessageData{
    QString name;//姓名
    QString headimage;//头像
    QString message;//消息

}LineMessageData;
class LineMessage : public QWidget
{
    Q_OBJECT

public:
    explicit LineMessage(LineMessageData lmDate,MessageUser msgUser=MessageUser_self,QWidget *parent = nullptr);
    ~LineMessage();
    void calculateAndSetHeight();

private:
    QLabel* lbhead;
    QWidget* msg;
    QWidget*title;
    QLabel* sendtime;
    QLabel*username;
    QLabel*usermessage;
    int lineheight;


};


#endif // LINEMESSAGE_H
